*===============================================================================
* Do-file creates "Household Survey Dataset: Violence and Cash Savings"
* Table 5
*===============================================================================
clear
set more off

cd "~/Dropbox/VFD/REStat_Native_Files/Stata_Files"
local output "~/Dropbox/VFD/REStat_Native_Files/Stata_Files/Output"

use ema_master_NATIVE.dta, clear


/// TABLE 5 /// 

local demog age employed education female risk_likert

areg cash_savings kinetic_dum_1k `demog' if insample==1, r abs(province) cl(pc) 
est store col1
estadd ysumm, mean prefix(in_sample_)
estadd local samplestr "Trimmed"
estadd local demog "YES"
estadd local provFE "YES"

areg cash_savings expects_violence `demog' if insample==1, r abs(province) cl(pc) 
est store col2
estadd ysumm, mean prefix(in_sample_)
estadd local samplestr "Trimmed"
estadd local demog "YES"
estadd local provFE "YES"

areg cash_savings  kinetic_dum_1k  expects_violence `demog' if insample==1, r abs(province) cl(pc) 
est store col3
estadd ysumm, mean prefix(in_sample_)
estadd local samplestr "Trimmed"
estadd local demog "YES"
estadd local provFE "YES"

areg cash_savings  kinetic_dum_1k  expects_violence ke `demog' if insample==1, r abs(province) cl(pc) 
est store col4
estadd ysumm, mean prefix(in_sample_)
estadd local samplestr "Trimmed"
estadd local demog "YES"
estadd local provFE "YES"

areg cash_savings  kinetic_dum_1k  expects_violence ke `demog', r abs(province) cl(pc) 
est store col5
estadd ysumm, mean prefix(in_sample_)
estadd local samplestr "All"
estadd local demog "YES"
estadd local provFE "YES"


estout col1 col2 col3 col4 col5, cells(b(fmt(%9.2f) star) se(par fmt(%9.2f))) ///
starlevels(* .1 ** .05 *** .01) style(tex) keep(kinetic_dum_1k  expects_violence ke _cons) ///
stats(samplestr in_sample_mean N_clust N r2 demog provFE, label("Sample" "Mean Dep Var" "\# Clusters" "\# Observations" "R-Squared" "Demographic Controls" "Province FE") fmt(0 2 0 0 3)) ///
 title("Cash Savings and Violence Expectations - National Sample") varlabels(kinetic_dum_1k "Attacks (=1)" expects_violence "Expects Violence (=1)" ke "Attacks x Expects"  _cons "Constant")
 
esttab col1 col2 col3 col4 col5 using "`output'/table_5.tex", cells(b(fmt(%9.2f) star) se(par fmt(%9.2f))) ///
starlevels(* .1 ** .05 *** .01) style(tex) keep(kinetic_dum_1k  expects_violence ke _cons) ///
stats(samplestr in_sample_mean N_clust N r2 demog provFE, label("Sample" "Mean Dep Var" "\# Clusters" "\# Observations" "R-Squared" "Demographic Controls" "Province FE") fmt(0 2 0 0 3)) ///
 title("Cash Savings and Violence Expectations - National Sample") varlabels(kinetic_dum_1k "Attacks (=1)" expects_violence "Expects Violence (=1)" ke "Attacks x Expects"  _cons "Constant") replace

